package parser;

public class ReadStateNIO {
    public boolean readMultiLine;
    public int count;
    public int type;
    public int index;
    public byte[][] args;
    public int bulkLen;
    public boolean readingRepl;
    public boolean isEnough;
    public boolean reachEOF;

    public static ReadStateNIO getDefaultState() {
        ReadStateNIO ret = new ReadStateNIO();
        ret.readMultiLine = false;
        ret.count = 0;
        ret.type = 0;
        ret.index = 0;
        ret.args = null;
        ret.bulkLen = 0;
        ret.readingRepl = false;
        ret.isEnough = false;
        ret.reachEOF = false;

        return ret;
    }

    public void reset() {
        readMultiLine = false;
        count = 0;
        type = 0;
        index = 0;
        args = null;
        bulkLen = 0;
        readingRepl = false;
        isEnough = false;
        reachEOF = false;
    }

    public boolean finish() {
        return count > 0 && count == index;
    }
}
